package com.bill.messages;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Properties;
import java.util.Set;

public class MessageServiceProperties extends Properties {
 

 

	/**
	 * 
	 */
public void setProperties(HashMap<String, String> val){
	 ArrayList<String> keys = new ArrayList<String>(val.keySet());
	List<String> values = new ArrayList<String>(val.values());
	for (int i = 0; i < values.size(); i++) {
		setProperty(keys.get(i), values.get(i));
	}
}
	private static final long serialVersionUID = 1L;

	public MessageServiceProperties() {
		super();
		// TODO Auto-generated constructor stub
	}

	public MessageServiceProperties(Properties defaults) {
		super(defaults);
		// TODO Auto-generated constructor stub
	}

	/**
	 * @return the username
	 */
	public String getUsername() {
		return (String) this.get("username");
		
		 
	}

	/**
	 * @param username the username to set
	 */
	public void setUsername(String username) {
		this.setProperty("username", username);
		 
	}

	/**
	 * @return the password
	 */
	public String getPassword() {
		return (String) this.get("password");
		 
	}

	/**
	 * @param password the password to set
	 */
	public void setPassword(String password) {
		this.setProperty("password", password);
		
		 
	}

	/**
	 * @return the host
	 */
	public String getHost() {
		return (String) this.get("mail.smtp.host");
	}

	/**
	 * @param host the host to set
	 */
	public void setHost(String host) {
		 
	        setProperty("mail.smtp.host", host);
	}

	/**
	 * @return the protocol
	 */
	public String getProtocol() {
		return (String) this.get("mail.transport.protocol");
	}

	/**
	 * @param protocol the protocol to set
	 */
	public void setProtocol(String protocol) {
		 setProperty("mail.transport.protocol", protocol);
	       
		 
	}

	/**
	 * @return the serialversionuid
	 */
	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	/**
	 * @return the starttls
	 */
	public String getStarttls() {
		return (String) get("mail.smtp.starttls.enable");
	}

	/**
	 * @param starttls the starttls to set
	 */
	public void setStarttls(String starttls) {
		setProperty("mail.smtp.starttls.enable", starttls);
	}

	/**
	 * @return the port
	 */
	public int getPort() {
		return Integer.parseInt((String) get("mail.smtp.port"));
	}

	/**
	 * @param port the port to set
	 */
	public void setPort(int port) {
		setProperty("mail.smtp.port", port+"");
	}

	/**
	 * @return the smtpauth
	 */
	public String getSmtpauth() {
	return 	(String) get("mail.smtp.auth");
	}

	/**
	 * @param smtpauth the smtpauth to set
	 */
	public void setSmtpauth(String smtpauth) {
		setProperty("mail.smtp.auth", smtpauth);
	}

	/**
	 * @return the smtpauth
	 */
	 

	/**
	 * @param smtpauth the smtpauth to set
	 */
	 
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	 

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
 
	 
}
